/*
 * Reference: https://jupyterbook.org/advanced/sphinx.html
 */

:root {
  --space: 12px;
  --space--small: 6px;
  --space--tiny: 3px;
  --space--big: 24px;
  --space--bigger: 36px;

  --inline-code-bgc: #f5f5f5;
  --text-color: rgba(var(--pst-color-paragraph), 1);

  --body-font-size: 1.3333333333rem;

  --pst-sidebar-font-size: 1rem;
  --pst-sidebar-caption-font-size: 1rem;
}

/*****************************************************************************
 * Sidebar
 *****************************************************************************/

/*
 * In the body, ul elements have a larger font size to match the body font
 * size. But that also affects sidebar elements, so we reset the sidebar font
 * size here.
 */
#site-navigation ul {
  font-size: 1rem;
}

/*
ul.current,
li.current > ul {
  font-size: 1rem;
}
*/

/*****************************************************************************
 * Footer styling
 *****************************************************************************/

/* Mimic JBook theme padding for body */

@media (min-width: 768px) {
  .footer {
    padding-left: 1rem;
  }
}

@media (min-width: 960px) {
  .footer {
    padding-left: 3rem;
  }
}

/*****************************************************************************
 * Notebook styling
 *****************************************************************************/

#main-content {
  padding-left: 0rem;
}

@media (min-width: 768px) {
  #main-content {
    padding-left: 0.6rem;
    /* 70% is the JBook theme default, and we set a hard max-width so that
     * lines don't get too long on wide screens */
    max-width: min(70%, 640px);
  }

  footer.footer-article .prev-next-area {
    max-width: min(70%, 640px);
  }
}

/*****************************************************************************
 * Jupyter Book Components
 *****************************************************************************/

/* Fix spacing between title and icon */
.admonition > .admonition-title,
div.admonition > .admonition-title {
  padding-left: 2.5rem;
}

/*****************************************************************************
 * Typography
 *****************************************************************************/

/*
 * Set up vertical rhythm:
 * https://iamsteve.me/blog/entry/a-guide-to-vertical-rhythm
 */
html {
  font-size: 12px;
}

body {
  /* Debugging grid */
  /* background-image: linear-gradient(#eee 1px, transparent 1px); */
  /* background-size: 100% 12px; */

  line-height: 1.5;
}

/* Reset font family */
body,
h1,
h2,
h3,
h4,
h5,
h6,
.header-style {
  font-family: -apple-system, BlinkMacSystemFont, 'Roboto', 'Segoe UI',
    'Helvetica Neue', 'Lucida Grande', Arial, sans-serif !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
}

/* Align to 72px */
h1 {
  font-size: 30px;
  line-height: 1.2;
  padding-top: 24px;
  margin-bottom: 12px;
}

/* Align to 48px */
h2 {
  font-size: 24px;
  line-height: 1.25;
  padding-top: 12px;
  margin-bottom: 6px;
}

/* Align to 36px */
h3 {
  font-size: 21px;
  line-height: 1.3333333;
  padding-top: 12px;
  margin-bottom: 8px;
}

/* Align to 24px */
p {
  font-size: var(--body-font-size);
  line-height: 1.5;
  margin-bottom: 1rem;
}

ol,
ul {
  font-size: var(--body-font-size);
}

/* Breaks vertical rhythm because this aligns to 16px */
pre {
  font-size: 1rem !important;
  line-height: 1.5 !important;

  padding: 0.666666667rem;
}

/* Wrap long output lines */
.cell_output .output pre {
  white-space: pre-wrap;
}

table,
.table {
  display: block;
  overflow: auto;
}

.table p {
  margin-bottom: 0;
}

.table td,
.table th {
  padding: 0.5rem;
}

div.container.cell {
  padding-right: 0;
}

div.cell_output tr,
div.cell_output th,
div.cell_output td {
  line-height: 1;
}

blockquote {
  padding: 0 1.5rem;
}

blockquote div > p {
  margin-bottom: 1rem;
}

code.literal {
  background: var(--inline-code-bgc);
  padding: 1px 4px;
  color: var(--text-color);
}

code.literal > span {
  font-size: 0.9em;
}

img {
  margin-bottom: 1rem;
}

/* don't top-align footnotes */
a.footnote-reference {
  vertical-align: initial;
}

/* Make bibliography font smaller */
.citation > dd > p {
  font-size: 1rem;
}

/*****************************************************************************
 * MathJax
 *****************************************************************************/

div.math {
  font-size: 1.21rem;
}

/*****************************************************************************
 * Print styling
 *****************************************************************************/

/* Don't show right table of contents or footer */
@media print {
  .bd-toc {
    visibility: hidden;
  }

  #bd-toc-nav {
    display: none;
  }

  .footer {
    display: none;
  }
}
